/*
 Navicat Premium Data Transfer

 Source Server         : localhost
 Source Server Type    : MySQL
 Source Server Version : 80023
 Source Host           : localhost:3306
 Source Schema         : united-ucts

 Target Server Type    : MySQL
 Target Server Version : 80023
 File Encoding         : 65001

 Date: 15/07/2021 14:10:33
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for sys_menu
-- ----------------------------
DROP TABLE IF EXISTS `sys_menu`;
CREATE TABLE `sys_menu` (
  `id` varchar(32) NOT NULL COMMENT '主键(菜单ID)',
  `parent_id` varchar(32) NOT NULL COMMENT '父级ID',
  `type` varchar(2) DEFAULT NULL COMMENT '菜单类型(0:菜单 1:按钮)',
  `title` varchar(200) NOT NULL COMMENT '菜单名称',
  `name` varchar(200) NOT NULL COMMENT '前端名称',
  `icon` varchar(200) DEFAULT NULL COMMENT '前端图标',
  `url` varchar(200) DEFAULT NULL COMMENT '菜单路径',
  `sort` int NOT NULL COMMENT '排序号',
  `hidden` varchar(1) DEFAULT '0' COMMENT '前端隐藏(0:否;1:是)',
  `remark` varchar(500) DEFAULT NULL COMMENT '描述',
  `status` varchar(1) NOT NULL DEFAULT '1' COMMENT '生效标识(0:失效;1:生效)',
  `delete_flag` varchar(1) NOT NULL DEFAULT '0' COMMENT '是否已删除(0:否;1:是)',
  `create_by` varchar(32) NOT NULL COMMENT '创建人',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_by` varchar(32) DEFAULT NULL COMMENT '更新人',
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='系统菜单表';

-- ----------------------------
-- Records of sys_menu
-- ----------------------------
BEGIN;
INSERT INTO `sys_menu` VALUES ('1', '0', '0', '商品', 'pms', 'product', NULL, 0, '0', NULL, '1', '0', '1', '2020-11-26 15:39:59', NULL, NULL);
INSERT INTO `sys_menu` VALUES ('10', '7', '1', '退货申请处理', 'returnApply', 'order-return', NULL, 0, '0', NULL, '1', '0', '1', '2020-11-26 15:40:35', NULL, NULL);
INSERT INTO `sys_menu` VALUES ('11', '7', '1', '退货原因设置', 'returnReason', 'order-return-reason', NULL, 0, '0', NULL, '1', '0', '1', '2020-11-26 15:40:36', NULL, NULL);
INSERT INTO `sys_menu` VALUES ('12', '0', '0', '营销', 'sms', 'sms', NULL, 0, '0', NULL, '1', '0', '1', '2020-11-26 15:40:37', NULL, NULL);
INSERT INTO `sys_menu` VALUES ('13', '12', '1', '秒杀活动列表', 'flash', 'sms-flash', NULL, 0, '0', NULL, '1', '0', '1', '2020-11-26 15:40:37', NULL, NULL);
INSERT INTO `sys_menu` VALUES ('14', '12', '1', '优惠券列表', 'coupon', 'sms-coupon', NULL, 0, '0', NULL, '1', '0', '1', '2020-11-26 15:40:38', NULL, NULL);
INSERT INTO `sys_menu` VALUES ('16', '12', '1', '品牌推荐', 'homeBrand', 'product-brand', NULL, 0, '0', NULL, '1', '0', '1', '2020-11-26 15:40:39', NULL, NULL);
INSERT INTO `sys_menu` VALUES ('17', '12', '1', '新品推荐', 'homeNew', 'sms-new', NULL, 0, '0', NULL, '1', '0', '1', '2020-11-26 15:40:40', NULL, NULL);
INSERT INTO `sys_menu` VALUES ('18', '12', '1', '人气推荐', 'homeHot', 'sms-hot', NULL, 0, '0', NULL, '1', '0', '1', '2020-11-26 15:40:41', NULL, NULL);
INSERT INTO `sys_menu` VALUES ('19', '12', '1', '专题推荐', 'homeSubject', 'sms-subject', NULL, 0, '0', NULL, '1', '0', '1', '2020-11-26 15:40:42', NULL, NULL);
INSERT INTO `sys_menu` VALUES ('2', '1', '1', '商品列表', 'product', 'product-list', NULL, 0, '0', NULL, '1', '0', '1', '2020-11-26 15:40:28', NULL, NULL);
INSERT INTO `sys_menu` VALUES ('20', '12', '1', '广告列表', 'homeAdvertise', 'sms-ad', NULL, 0, '0', NULL, '1', '0', '1', '2020-11-26 15:40:43', NULL, NULL);
INSERT INTO `sys_menu` VALUES ('21', '0', '0', '权限', 'ums', 'ums', NULL, 0, '0', NULL, '1', '0', '1', '2020-11-26 15:40:43', NULL, NULL);
INSERT INTO `sys_menu` VALUES ('22', '21', '1', '用户列表', 'admin', 'ums-admin', NULL, 0, '0', NULL, '1', '0', '1', '2020-11-26 15:40:44', NULL, NULL);
INSERT INTO `sys_menu` VALUES ('23', '21', '1', '角色列表', 'role', 'ums-role', NULL, 0, '0', NULL, '1', '0', '1', '2020-11-26 15:40:45', NULL, NULL);
INSERT INTO `sys_menu` VALUES ('24', '21', '1', '菜单列表', 'menu', 'ums-menu', NULL, 0, '0', NULL, '1', '0', '1', '2020-11-26 15:40:46', NULL, NULL);
INSERT INTO `sys_menu` VALUES ('25', '21', '1', '资源列表', 'resource', 'ums-resource', NULL, 0, '0', NULL, '1', '0', '1', '2020-11-26 15:40:47', NULL, NULL);
INSERT INTO `sys_menu` VALUES ('3', '1', '1', '添加商品', 'addProduct', 'product-add', NULL, 0, '0', NULL, '1', '0', '1', '2020-11-26 15:40:29', NULL, NULL);
INSERT INTO `sys_menu` VALUES ('4', '1', '1', '商品分类', 'productCate', 'product-cate', NULL, 0, '0', NULL, '1', '0', '1', '2020-11-26 15:40:30', NULL, NULL);
INSERT INTO `sys_menu` VALUES ('5', '1', '1', '商品类型', 'productAttr', 'product-attr', NULL, 0, '0', NULL, '1', '0', '1', '2020-11-26 15:40:31', NULL, NULL);
INSERT INTO `sys_menu` VALUES ('6', '1', '1', '品牌管理', 'brand', 'product-brand', NULL, 0, '0', NULL, '1', '0', '1', '2020-11-26 15:40:31', NULL, NULL);
INSERT INTO `sys_menu` VALUES ('7', '0', '0', '订单', 'oms', 'order', NULL, 0, '0', NULL, '1', '0', '1', '2020-11-26 15:40:32', NULL, NULL);
INSERT INTO `sys_menu` VALUES ('8', '7', '1', '订单列表', 'order', 'product-list', NULL, 0, '0', NULL, '1', '0', '1', '2020-11-26 15:40:33', NULL, NULL);
INSERT INTO `sys_menu` VALUES ('9', '7', '1', '订单设置', 'orderSetting', 'order-setting', NULL, 0, '0', NULL, '1', '0', '1', '2020-11-26 15:40:34', NULL, NULL);
COMMIT;

-- ----------------------------
-- Table structure for sys_org
-- ----------------------------
DROP TABLE IF EXISTS `sys_org`;
CREATE TABLE `sys_org` (
  `id` varchar(32) NOT NULL COMMENT '数据主键',
  `org_no` varchar(20) NOT NULL COMMENT '机构编号',
  `parent_no` varchar(20) DEFAULT NULL COMMENT '上级机构编号',
  `rank` varchar(3) DEFAULT NULL COMMENT '机构级别(1:一级;2:二级;3:三级)',
  `org_code` varchar(32) DEFAULT NULL COMMENT '核心机构号',
  `branch_code` varchar(12) DEFAULT NULL COMMENT '金融机构标识码',
  `org_name` varchar(200) NOT NULL COMMENT '机构名称',
  `short_name` varchar(100) NOT NULL COMMENT '机构简称',
  `address` varchar(200) DEFAULT NULL COMMENT '机构地址',
  `en_name` varchar(200) DEFAULT NULL COMMENT '英文名称',
  `short_en_name` varchar(100) DEFAULT NULL COMMENT '英文简称',
  `en_address` varchar(200) DEFAULT NULL COMMENT '英文联系地址',
  `swift_code` varchar(11) DEFAULT NULL COMMENT 'swift_code',
  `virtual_flag` varchar(3) NOT NULL DEFAULT '0' COMMENT '是否虚拟机构(0:否; 1:是)',
  `buss_flag` varchar(3) NOT NULL DEFAULT '0' COMMENT '是否业务处理机构(0:否; 1:是)',
  `declare_flag` varchar(3) NOT NULL DEFAULT '0' COMMENT '是否申报机构(0:否; 1:是)',
  `foreign_flag` varchar(3) NOT NULL COMMENT '是否具有外汇经营权限(0:否; 1:是)',
  `parities_flag` varchar(3) NOT NULL DEFAULT '0' COMMENT '是否有汇率发布权限',
  `corp_kind` varchar(3) NOT NULL DEFAULT '0' COMMENT '对公对私标识(0:否; 1:是)',
  `buss_code_no` varchar(5) DEFAULT NULL COMMENT '业务编号识别序号',
  `big_bank_no` varchar(14) DEFAULT NULL COMMENT '大额行号',
  `big_bank_name` varchar(200) DEFAULT NULL COMMENT '大额行名',
  `link_man` varchar(40) DEFAULT NULL COMMENT '联系人',
  `telephone` varchar(40) DEFAULT NULL COMMENT '联系电话',
  `fax_no` varchar(40) DEFAULT NULL COMMENT '传真',
  `sort` bigint NOT NULL DEFAULT '1' COMMENT '排序号',
  `remark` varchar(255) DEFAULT NULL COMMENT '描述信息',
  `status` varchar(1) NOT NULL DEFAULT '1' COMMENT '生效标识(0:失效;1:生效)',
  `delete_flag` varchar(1) NOT NULL DEFAULT '0' COMMENT '是否已删除(0:否;1:是)',
  `create_by` varchar(32) DEFAULT NULL COMMENT '创建人',
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_by` varchar(32) DEFAULT NULL COMMENT '更新人',
  `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `primarysys_org1` (`id`),
  UNIQUE KEY `sys_org_org_no_uindex` (`org_no`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='机构信息表';

-- ----------------------------
-- Records of sys_org
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for sys_permission
-- ----------------------------
DROP TABLE IF EXISTS `sys_permission`;
CREATE TABLE `sys_permission` (
  `id` varchar(32) NOT NULL COMMENT '主键(权限ID)',
  `parent_id` varchar(32) DEFAULT NULL COMMENT '父级权限id',
  `name` varchar(100) DEFAULT NULL COMMENT '权限名称',
  `value` varchar(200) DEFAULT NULL COMMENT '权限值',
  `icon` varchar(500) DEFAULT NULL COMMENT '图标',
  `type` int DEFAULT NULL COMMENT '权限类型：0->目录；1->菜单；2->按钮（接口绑定权限）',
  `uri` varchar(200) DEFAULT NULL COMMENT '前端资源路径',
  `sort` int DEFAULT '0' COMMENT '排序',
  `remark` varchar(500) DEFAULT NULL COMMENT '描述',
  `status` varchar(1) NOT NULL DEFAULT '1' COMMENT '生效标识(0:失效;1:生效)',
  `delete_flag` varchar(1) NOT NULL DEFAULT '0' COMMENT '是否已删除(0:否;1:是)',
  `create_by` varchar(32) NOT NULL COMMENT '创建人',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_by` varchar(32) DEFAULT NULL COMMENT '更新人',
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='系统用户权限表';

-- ----------------------------
-- Records of sys_permission
-- ----------------------------
BEGIN;
INSERT INTO `sys_permission` VALUES ('1', '0', '商品', NULL, NULL, 0, NULL, 0, NULL, '1', '0', '1', '2020-11-26 15:46:56', NULL, NULL);
INSERT INTO `sys_permission` VALUES ('10', '4', '修改商品分类', 'pms:productCategory:update', NULL, 2, '/pms/productCate/update', 0, NULL, '1', '0', '1', '2020-11-26 15:47:04', NULL, NULL);
INSERT INTO `sys_permission` VALUES ('11', '4', '删除商品分类', 'pms:productCategory:delete', NULL, 2, '/pms/productAttr/delete', 0, NULL, '1', '0', '1', '2020-11-26 15:47:05', NULL, NULL);
INSERT INTO `sys_permission` VALUES ('12', '5', '添加商品类型', 'pms:productAttribute:create', NULL, 2, '/pms/productAttr/create', 0, NULL, '1', '0', '1', '2020-11-26 15:47:05', NULL, NULL);
INSERT INTO `sys_permission` VALUES ('13', '5', '修改商品类型', 'pms:productAttribute:update', NULL, 2, '/pms/productAttr/update', 0, NULL, '1', '0', '1', '2020-11-26 15:47:06', NULL, NULL);
INSERT INTO `sys_permission` VALUES ('14', '5', '删除商品类型', 'pms:productAttribute:delete', NULL, 2, '/pms/productAttr/delete', 0, NULL, '1', '0', '1', '2020-11-26 15:47:07', NULL, NULL);
INSERT INTO `sys_permission` VALUES ('15', '6', '添加品牌', 'pms:brand:create', NULL, 2, '/pms/brand/add', 0, NULL, '1', '0', '1', '2020-11-26 15:47:08', NULL, NULL);
INSERT INTO `sys_permission` VALUES ('16', '6', '修改品牌', 'pms:brand:update', NULL, 2, '/pms/brand/update', 0, NULL, '1', '0', '1', '2020-11-26 15:47:09', NULL, NULL);
INSERT INTO `sys_permission` VALUES ('17', '6', '删除品牌', 'pms:brand:delete', NULL, 2, '/pms/brand/delete', 0, NULL, '1', '0', '1', '2020-11-26 15:47:10', NULL, NULL);
INSERT INTO `sys_permission` VALUES ('18', '0', '首页', NULL, NULL, 0, '/hello', 0, NULL, '1', '0', '1', '2020-11-26 15:47:11', NULL, NULL);
INSERT INTO `sys_permission` VALUES ('2', '1', '商品列表', 'pms:product:read', NULL, 1, '/pms/product/index', 0, NULL, '1', '0', '1', '2020-11-26 15:46:56', NULL, NULL);
INSERT INTO `sys_permission` VALUES ('3', '1', '添加商品', 'pms:product:create', NULL, 1, '/pms/product/add', 0, NULL, '1', '0', '1', '2020-11-26 15:46:57', NULL, NULL);
INSERT INTO `sys_permission` VALUES ('4', '1', '商品分类', 'pms:productCategory:read', NULL, 1, '/pms/productCate/index', 0, NULL, '1', '0', '1', '2020-11-26 15:46:58', NULL, NULL);
INSERT INTO `sys_permission` VALUES ('5', '1', '商品类型', 'pms:productAttribute:read', NULL, 1, '/pms/productAttr/index', 0, NULL, '1', '0', '1', '2020-11-26 15:46:59', NULL, NULL);
INSERT INTO `sys_permission` VALUES ('6', '1', '品牌管理', 'pms:brand:read', NULL, 1, '/pms/brand/index', 0, NULL, '1', '0', '1', '2020-11-26 15:47:00', NULL, NULL);
INSERT INTO `sys_permission` VALUES ('7', '2', '编辑商品', 'pms:product:update', NULL, 2, '/pms/product/updateProduct', 0, NULL, '1', '0', '1', '2020-11-26 15:47:01', NULL, NULL);
INSERT INTO `sys_permission` VALUES ('8', '2', '删除商品', 'pms:product:delete', NULL, 2, '/pms/product/delete', 0, NULL, '1', '0', '1', '2020-11-26 15:47:01', NULL, NULL);
INSERT INTO `sys_permission` VALUES ('9', '4', '添加商品分类', 'pms:productCategory:create', NULL, 2, '/pms/productCate/create', 0, NULL, '1', '0', '1', '2020-11-26 15:47:03', NULL, NULL);
COMMIT;

-- ----------------------------
-- Table structure for sys_resource
-- ----------------------------
DROP TABLE IF EXISTS `sys_resource`;
CREATE TABLE `sys_resource` (
  `id` varchar(32) NOT NULL COMMENT '数据主键',
  `category_id` varchar(32) DEFAULT NULL COMMENT '资源分类ID',
  `name` varchar(200) DEFAULT NULL COMMENT '资源名称',
  `url` varchar(200) DEFAULT NULL COMMENT '资源URL',
  `remark` varchar(500) DEFAULT NULL COMMENT '描述',
  `status` varchar(1) NOT NULL DEFAULT '1' COMMENT '生效标识(0:失效;1:生效)',
  `delete_flag` varchar(1) NOT NULL DEFAULT '0' COMMENT '是否已删除(0:否;1:是)',
  `create_by` varchar(32) NOT NULL COMMENT '创建人',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_by` varchar(32) DEFAULT NULL COMMENT '更新人',
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='后台资源表';

-- ----------------------------
-- Records of sys_resource
-- ----------------------------
BEGIN;
INSERT INTO `sys_resource` VALUES ('1', '1', '品品牌管理', '/brand/**', '', '1', '0', '1', '2021-07-15 05:36:44', NULL, '2021-07-15 05:36:44');
INSERT INTO `sys_resource` VALUES ('10', '2', '退货原因管理', '/returnReason/**', '', '1', '0', '1', '2021-07-15 05:36:45', NULL, '2021-07-15 05:36:45');
INSERT INTO `sys_resource` VALUES ('11', '2', '订单设置管理', '/orderSetting/**', '', '1', '0', '1', '2021-07-15 05:36:45', NULL, '2021-07-15 05:36:45');
INSERT INTO `sys_resource` VALUES ('12', '2', '收货地址管理', '/companyAddress/**', '', '1', '0', '1', '2021-07-15 05:36:45', NULL, '2021-07-15 05:36:45');
INSERT INTO `sys_resource` VALUES ('13', '3', '优惠券管理', '/coupon/**', '', '1', '0', '1', '2021-07-15 05:36:45', NULL, '2021-07-15 05:36:45');
INSERT INTO `sys_resource` VALUES ('14', '3', '优惠券领取记录管理', '/couponHistory/**', '', '1', '0', '1', '2021-07-15 05:36:46', NULL, '2021-07-15 05:36:46');
INSERT INTO `sys_resource` VALUES ('15', '3', '限时购活动管理', '/flash/**', '', '1', '0', '1', '2021-07-15 05:36:46', NULL, '2021-07-15 05:36:46');
INSERT INTO `sys_resource` VALUES ('16', '3', '限时购商品关系管理', '/flashProductRelation/**', '', '1', '0', '1', '2021-07-15 05:36:46', NULL, '2021-07-15 05:36:46');
INSERT INTO `sys_resource` VALUES ('17', '3', '限时购场次管理', '/flashSession/**', '', '1', '0', '1', '2021-07-15 05:36:46', NULL, '2021-07-15 05:36:46');
INSERT INTO `sys_resource` VALUES ('18', '3', '首页轮播广告管理', '/home/advertise/**', '', '1', '0', '1', '2021-07-15 05:36:46', NULL, '2021-07-15 05:36:46');
INSERT INTO `sys_resource` VALUES ('19', '3', '首页品牌管理', '/home/brand/**', '', '1', '0', '1', '2021-07-15 05:36:46', NULL, '2021-07-15 05:36:46');
INSERT INTO `sys_resource` VALUES ('2', '1', '品属性分类管理', '/productAttribute/**', '', '1', '0', '1', '2021-07-15 05:36:44', NULL, '2021-07-15 05:36:44');
INSERT INTO `sys_resource` VALUES ('20', '3', '首页新品管理', '/home/newProduct/**', '', '1', '0', '1', '2021-07-15 05:36:46', NULL, '2021-07-15 05:36:46');
INSERT INTO `sys_resource` VALUES ('21', '3', '首页人气推荐管理', '/home/recommendProduct/**', '', '1', '0', '1', '2021-07-15 05:36:47', NULL, '2021-07-15 05:36:47');
INSERT INTO `sys_resource` VALUES ('22', '3', '首页专题推荐管理', '/home/recommendSubject/**', '', '1', '0', '1', '2021-07-15 05:36:47', NULL, '2021-07-15 05:36:47');
INSERT INTO `sys_resource` VALUES ('23', '5', '商品优选管理', '/prefrenceArea/**', '', '1', '0', '1', '2021-07-15 05:36:47', NULL, '2021-07-15 05:36:47');
INSERT INTO `sys_resource` VALUES ('24', '5', '商品专题管理', '/subject/**', '', '1', '0', '1', '2021-07-15 05:36:47', NULL, '2021-07-15 05:36:47');
INSERT INTO `sys_resource` VALUES ('25', '4', '后台用户管理', '/admin/**', '', '1', '0', '1', '2021-07-15 05:36:47', NULL, '2021-07-15 05:36:47');
INSERT INTO `sys_resource` VALUES ('26', '4', '后台用户角色管理', '/role/**', '', '1', '0', '1', '2021-07-15 05:36:47', NULL, '2021-07-15 05:36:47');
INSERT INTO `sys_resource` VALUES ('27', '4', '后台菜单管理', '/menu/**', '', '1', '0', '1', '2021-07-15 05:36:47', NULL, '2021-07-15 05:36:47');
INSERT INTO `sys_resource` VALUES ('28', '4', '后台资源分类管理', '/resourceCategory/**', '', '1', '0', '1', '2021-07-15 05:36:47', NULL, '2021-07-15 05:36:47');
INSERT INTO `sys_resource` VALUES ('29', '4', '后台资源管理', '/resource/**', '', '1', '0', '1', '2021-07-15 05:36:48', NULL, '2021-07-15 05:36:48');
INSERT INTO `sys_resource` VALUES ('3', '1', '品属性管理', '/productAttribute/**', '', '1', '0', '1', '2021-07-15 05:36:44', NULL, '2021-07-15 05:36:44');
INSERT INTO `sys_resource` VALUES ('4', '1', '品分类管理', '/productCategory/**', '', '1', '0', '1', '2021-07-15 05:36:44', NULL, '2021-07-15 05:36:44');
INSERT INTO `sys_resource` VALUES ('5', '1', '品管理', '/product/**', '', '1', '0', '1', '2021-07-15 05:36:44', NULL, '2021-07-15 05:36:44');
INSERT INTO `sys_resource` VALUES ('6', '1', '品库存管理', '/sku/**', '', '1', '0', '1', '2021-07-15 05:36:44', NULL, '2021-07-15 05:36:44');
INSERT INTO `sys_resource` VALUES ('8', '2', '单管理', '/order/**', '', '1', '0', '1', '2021-07-15 05:36:45', NULL, '2021-07-15 05:36:45');
INSERT INTO `sys_resource` VALUES ('9', '2', '订单退货申请管理', '/returnApply/**', '', '1', '0', '1', '2021-07-15 05:36:45', NULL, '2021-07-15 05:36:45');
COMMIT;

-- ----------------------------
-- Table structure for sys_resource_category
-- ----------------------------
DROP TABLE IF EXISTS `sys_resource_category`;
CREATE TABLE `sys_resource_category` (
  `id` varchar(32) NOT NULL COMMENT '数据主键',
  `name` varchar(200) DEFAULT NULL COMMENT '分类名称',
  `sort` int DEFAULT NULL COMMENT '排序',
  `remark` varchar(500) DEFAULT NULL COMMENT '描述',
  `status` varchar(1) NOT NULL DEFAULT '1' COMMENT '生效标识(0:失效;1:生效)',
  `delete_flag` varchar(1) NOT NULL DEFAULT '0' COMMENT '是否已删除(0:否;1:是)',
  `create_by` varchar(32) NOT NULL COMMENT '创建人',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_by` varchar(32) DEFAULT NULL COMMENT '更新人',
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='资源分类表';

-- ----------------------------
-- Records of sys_resource_category
-- ----------------------------
BEGIN;
INSERT INTO `sys_resource_category` VALUES ('1', '业务模块', 0, NULL, '1', '0', '1', '2020-11-26 15:49:53', NULL, NULL);
INSERT INTO `sys_resource_category` VALUES ('2', '参数模块', 0, NULL, '1', '0', '1', '2020-11-26 15:49:54', NULL, NULL);
INSERT INTO `sys_resource_category` VALUES ('3', '系统模块', 0, NULL, '1', '0', '1', '2020-11-26 15:49:55', NULL, NULL);
INSERT INTO `sys_resource_category` VALUES ('4', '报表模块', 0, NULL, '1', '0', '1', '2020-11-26 15:49:56', NULL, NULL);
INSERT INTO `sys_resource_category` VALUES ('5', '内容模块', 0, NULL, '1', '0', '1', '2020-11-26 15:49:57', NULL, NULL);
INSERT INTO `sys_resource_category` VALUES ('6', '其他模块', 0, NULL, '1', '0', '1', '2020-11-26 15:49:58', NULL, NULL);
COMMIT;

-- ----------------------------
-- Table structure for sys_role
-- ----------------------------
DROP TABLE IF EXISTS `sys_role`;
CREATE TABLE `sys_role` (
  `id` varchar(32) NOT NULL COMMENT '数据主键',
  `name` varchar(100) DEFAULT NULL COMMENT '角色名称',
  `user_count` int DEFAULT NULL COMMENT '后台用户数量',
  `sort` int DEFAULT '0' COMMENT '排序',
  `remark` varchar(500) DEFAULT NULL COMMENT '描述',
  `status` varchar(1) NOT NULL DEFAULT '1' COMMENT '生效标识(0:失效;1:生效)',
  `delete_flag` varchar(1) NOT NULL DEFAULT '0' COMMENT '是否已删除(0:否;1:是)',
  `create_by` varchar(32) NOT NULL COMMENT '创建人',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_by` varchar(32) DEFAULT NULL COMMENT '更新人',
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='后台用户角色表';

-- ----------------------------
-- Records of sys_role
-- ----------------------------
BEGIN;
INSERT INTO `sys_role` VALUES ('1', '商品管理员', NULL, 0, '只能查看及操作商品', '1', '0', '1', '2020-11-26 15:51:48', NULL, NULL);
INSERT INTO `sys_role` VALUES ('2', '订单管理员', NULL, 0, '只能查看及操作订单', '1', '0', '1', '2020-11-26 15:51:49', NULL, NULL);
INSERT INTO `sys_role` VALUES ('5', '超级管理员', NULL, 0, '拥有所有查看和操作功能', '1', '0', '1', '2020-11-26 15:51:50', NULL, NULL);
COMMIT;

-- ----------------------------
-- Table structure for sys_role_menu
-- ----------------------------
DROP TABLE IF EXISTS `sys_role_menu`;
CREATE TABLE `sys_role_menu` (
  `id` varchar(32) NOT NULL COMMENT '数据主键',
  `role_id` varchar(32) NOT NULL COMMENT '角色ID',
  `menu_id` varchar(32) NOT NULL COMMENT '菜单ID',
  PRIMARY KEY (`id`),
  KEY `sys_role_menu_role_id_menu_id_index` (`role_id`,`menu_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='后台角色菜单关系表';

-- ----------------------------
-- Records of sys_role_menu
-- ----------------------------
BEGIN;
INSERT INTO `sys_role_menu` VALUES ('1', '1', '1');
INSERT INTO `sys_role_menu` VALUES ('2', '1', '2');
INSERT INTO `sys_role_menu` VALUES ('3', '1', '3');
INSERT INTO `sys_role_menu` VALUES ('4', '1', '4');
INSERT INTO `sys_role_menu` VALUES ('5', '1', '5');
INSERT INTO `sys_role_menu` VALUES ('6', '1', '6');
INSERT INTO `sys_role_menu` VALUES ('10', '2', '10');
INSERT INTO `sys_role_menu` VALUES ('11', '2', '11');
INSERT INTO `sys_role_menu` VALUES ('7', '2', '7');
INSERT INTO `sys_role_menu` VALUES ('8', '2', '8');
INSERT INTO `sys_role_menu` VALUES ('9', '2', '9');
INSERT INTO `sys_role_menu` VALUES ('12', '5', '1');
INSERT INTO `sys_role_menu` VALUES ('21', '5', '10');
INSERT INTO `sys_role_menu` VALUES ('22', '5', '11');
INSERT INTO `sys_role_menu` VALUES ('23', '5', '12');
INSERT INTO `sys_role_menu` VALUES ('24', '5', '13');
INSERT INTO `sys_role_menu` VALUES ('25', '5', '14');
INSERT INTO `sys_role_menu` VALUES ('26', '5', '16');
INSERT INTO `sys_role_menu` VALUES ('27', '5', '17');
INSERT INTO `sys_role_menu` VALUES ('28', '5', '18');
INSERT INTO `sys_role_menu` VALUES ('29', '5', '19');
INSERT INTO `sys_role_menu` VALUES ('13', '5', '2');
INSERT INTO `sys_role_menu` VALUES ('30', '5', '20');
INSERT INTO `sys_role_menu` VALUES ('31', '5', '21');
INSERT INTO `sys_role_menu` VALUES ('32', '5', '22');
INSERT INTO `sys_role_menu` VALUES ('33', '5', '23');
INSERT INTO `sys_role_menu` VALUES ('34', '5', '24');
INSERT INTO `sys_role_menu` VALUES ('35', '5', '25');
INSERT INTO `sys_role_menu` VALUES ('14', '5', '3');
INSERT INTO `sys_role_menu` VALUES ('15', '5', '4');
INSERT INTO `sys_role_menu` VALUES ('16', '5', '5');
INSERT INTO `sys_role_menu` VALUES ('17', '5', '6');
INSERT INTO `sys_role_menu` VALUES ('18', '5', '7');
INSERT INTO `sys_role_menu` VALUES ('19', '5', '8');
INSERT INTO `sys_role_menu` VALUES ('20', '5', '9');
COMMIT;

-- ----------------------------
-- Table structure for sys_role_permission
-- ----------------------------
DROP TABLE IF EXISTS `sys_role_permission`;
CREATE TABLE `sys_role_permission` (
  `id` varchar(32) NOT NULL COMMENT '数据主键',
  `role_id` varchar(32) NOT NULL COMMENT '角色ID',
  `permission_id` varchar(32) NOT NULL COMMENT '权限ID',
  PRIMARY KEY (`id`),
  KEY `sys_role_permission_role_id_permission_id_index` (`role_id`,`permission_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='后台用户角色和权限关系表';

-- ----------------------------
-- Records of sys_role_permission
-- ----------------------------
BEGIN;
INSERT INTO `sys_role_permission` VALUES ('1', '1', '1');
INSERT INTO `sys_role_permission` VALUES ('2', '1', '2');
INSERT INTO `sys_role_permission` VALUES ('3', '1', '3');
INSERT INTO `sys_role_permission` VALUES ('4', '1', '7');
INSERT INTO `sys_role_permission` VALUES ('5', '1', '8');
INSERT INTO `sys_role_permission` VALUES ('8', '2', '10');
INSERT INTO `sys_role_permission` VALUES ('9', '2', '11');
INSERT INTO `sys_role_permission` VALUES ('6', '2', '4');
INSERT INTO `sys_role_permission` VALUES ('7', '2', '9');
INSERT INTO `sys_role_permission` VALUES ('11', '3', '12');
INSERT INTO `sys_role_permission` VALUES ('12', '3', '13');
INSERT INTO `sys_role_permission` VALUES ('13', '3', '14');
INSERT INTO `sys_role_permission` VALUES ('10', '3', '5');
INSERT INTO `sys_role_permission` VALUES ('15', '4', '15');
INSERT INTO `sys_role_permission` VALUES ('16', '4', '16');
INSERT INTO `sys_role_permission` VALUES ('17', '4', '17');
INSERT INTO `sys_role_permission` VALUES ('14', '4', '6');
COMMIT;

-- ----------------------------
-- Table structure for sys_role_resource
-- ----------------------------
DROP TABLE IF EXISTS `sys_role_resource`;
CREATE TABLE `sys_role_resource` (
  `id` varchar(32) NOT NULL COMMENT '数据主键',
  `role_id` varchar(32) NOT NULL COMMENT '角色ID',
  `resource_id` varchar(32) NOT NULL COMMENT '资源ID',
  PRIMARY KEY (`id`),
  KEY `sys_role_resource_role_id_resource_id_index` (`role_id`,`resource_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='后台角色资源关系表';

-- ----------------------------
-- Records of sys_role_resource
-- ----------------------------
BEGIN;
INSERT INTO `sys_role_resource` VALUES ('34', '1', '1');
INSERT INTO `sys_role_resource` VALUES ('35', '1', '2');
INSERT INTO `sys_role_resource` VALUES ('40', '1', '23');
INSERT INTO `sys_role_resource` VALUES ('41', '1', '24');
INSERT INTO `sys_role_resource` VALUES ('36', '1', '3');
INSERT INTO `sys_role_resource` VALUES ('37', '1', '4');
INSERT INTO `sys_role_resource` VALUES ('38', '1', '5');
INSERT INTO `sys_role_resource` VALUES ('39', '1', '6');
INSERT INTO `sys_role_resource` VALUES ('3', '2', '10');
INSERT INTO `sys_role_resource` VALUES ('4', '2', '11');
INSERT INTO `sys_role_resource` VALUES ('5', '2', '12');
INSERT INTO `sys_role_resource` VALUES ('1', '2', '8');
INSERT INTO `sys_role_resource` VALUES ('2', '2', '9');
INSERT INTO `sys_role_resource` VALUES ('6', '5', '1');
INSERT INTO `sys_role_resource` VALUES ('14', '5', '10');
INSERT INTO `sys_role_resource` VALUES ('15', '5', '11');
INSERT INTO `sys_role_resource` VALUES ('16', '5', '12');
INSERT INTO `sys_role_resource` VALUES ('17', '5', '13');
INSERT INTO `sys_role_resource` VALUES ('18', '5', '14');
INSERT INTO `sys_role_resource` VALUES ('19', '5', '15');
INSERT INTO `sys_role_resource` VALUES ('20', '5', '16');
INSERT INTO `sys_role_resource` VALUES ('21', '5', '17');
INSERT INTO `sys_role_resource` VALUES ('22', '5', '18');
INSERT INTO `sys_role_resource` VALUES ('23', '5', '19');
INSERT INTO `sys_role_resource` VALUES ('7', '5', '2');
INSERT INTO `sys_role_resource` VALUES ('24', '5', '20');
INSERT INTO `sys_role_resource` VALUES ('25', '5', '21');
INSERT INTO `sys_role_resource` VALUES ('26', '5', '22');
INSERT INTO `sys_role_resource` VALUES ('27', '5', '23');
INSERT INTO `sys_role_resource` VALUES ('28', '5', '24');
INSERT INTO `sys_role_resource` VALUES ('29', '5', '25');
INSERT INTO `sys_role_resource` VALUES ('30', '5', '26');
INSERT INTO `sys_role_resource` VALUES ('31', '5', '27');
INSERT INTO `sys_role_resource` VALUES ('32', '5', '28');
INSERT INTO `sys_role_resource` VALUES ('33', '5', '29');
INSERT INTO `sys_role_resource` VALUES ('8', '5', '3');
INSERT INTO `sys_role_resource` VALUES ('9', '5', '4');
INSERT INTO `sys_role_resource` VALUES ('10', '5', '5');
INSERT INTO `sys_role_resource` VALUES ('11', '5', '6');
INSERT INTO `sys_role_resource` VALUES ('12', '5', '8');
INSERT INTO `sys_role_resource` VALUES ('13', '5', '9');
COMMIT;

-- ----------------------------
-- Table structure for sys_admin
-- ----------------------------
DROP TABLE IF EXISTS `sys_admin`;
CREATE TABLE `sys_admin` (
  `id` varchar(32) NOT NULL COMMENT '数据主键',
  `user_no` varchar(16) NOT NULL COMMENT '用户编号',
  `user_name` varchar(100) DEFAULT NULL COMMENT '用户名称',
  `user_pwd` varchar(100) DEFAULT NULL COMMENT '登录密码',
  `org_no` varchar(64) NOT NULL COMMENT '所属机构',
  `level` varchar(3) DEFAULT NULL COMMENT '用户级别',
  `photo` varchar(200) DEFAULT NULL COMMENT '头像',
  `sex` varchar(1) DEFAULT '2' COMMENT '性别(0:男;1:女;2:未知)',
  `phone` varchar(50) DEFAULT NULL COMMENT '联系电话',
  `id_code` varchar(20) DEFAULT NULL COMMENT '身份证号码',
  `login_ip` varchar(32) DEFAULT NULL COMMENT '最后登录ip',
  `login_date` datetime DEFAULT NULL COMMENT '最后登录时间',
  `login_flag` varchar(64) NOT NULL DEFAULT '1' COMMENT '是否可登录(0:否; 1:是)',
  `sort` bigint NOT NULL DEFAULT '1' COMMENT '排序号',
  `remark` varchar(255) DEFAULT NULL COMMENT '备注信息',
  `status` varchar(1) NOT NULL DEFAULT '1' COMMENT '生效标识(0:失效;1:生效)',
  `delete_flag` varchar(1) NOT NULL DEFAULT '0' COMMENT '是否已删除(0:否;1:是)',
  `create_by` varchar(32) NOT NULL COMMENT '创建人',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_by` varchar(32) DEFAULT NULL COMMENT '更新人',
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  UNIQUE KEY `primarysys_admin1` (`id`),
  UNIQUE KEY `sys_admin_user_no_uindex` (`user_no`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='系统用户信息表';

-- ----------------------------
-- Records of sys_admin
-- ----------------------------
BEGIN;
INSERT INTO `sys_admin` VALUES ('1', '888888', NULL, '$2a$10$4cGL5sQ84AOVVaj38GATSe2S8Ez/dJxGmGcZDf2CKjOW.y2Gy8pzq', '1000000001', NULL, NULL, '2', NULL, NULL, '127.0.0.1', '2021-07-15 11:40:25', '1', 1, NULL, '1', '0', '1', NULL, NULL, NULL);
INSERT INTO `sys_admin` VALUES ('2', '999999', '999999', '$2a$10$Rwv4uhCCqGbi04nbBW/fhuJde8VdxS9E6phNp/uUf0XUbCC/nCKRC', '1000000001', NULL, NULL, '2', NULL, NULL, NULL, NULL, '1', 1, NULL, '1', '0', '2', '2020-11-25 23:43:17', NULL, NULL);
COMMIT;

-- ----------------------------
-- Table structure for sys_admin_permission
-- ----------------------------
DROP TABLE IF EXISTS `sys_admin_permission`;
CREATE TABLE `sys_admin_permission` (
  `id` varchar(32) NOT NULL COMMENT '数据主键',
  `user_id` varchar(32) NOT NULL COMMENT '用户ID',
  `permission_id` varchar(32) NOT NULL COMMENT '权限ID',
  `type` int DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='后台用户和权限关系表(除角色中定义的权限以外的加减权限)';

-- ----------------------------
-- Records of sys_admin_permission
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for sys_admin_role
-- ----------------------------
DROP TABLE IF EXISTS `sys_admin_role`;
CREATE TABLE `sys_admin_role` (
  `id` varchar(32) NOT NULL COMMENT '数据主键',
  `user_id` varchar(32) NOT NULL COMMENT '用户ID',
  `role_id` varchar(32) NOT NULL COMMENT '角色ID',
  PRIMARY KEY (`id`),
  UNIQUE KEY `sys_admin_role_user_id_role_id_uindex` (`user_id`,`role_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='用户和角色关系表';

-- ----------------------------
-- Records of sys_admin_role
-- ----------------------------
BEGIN;
INSERT INTO `sys_admin_role` VALUES ('4', '1', '5');
INSERT INTO `sys_admin_role` VALUES ('1', '3', '5');
INSERT INTO `sys_admin_role` VALUES ('5', '4', '5');
INSERT INTO `sys_admin_role` VALUES ('2', '6', '1');
INSERT INTO `sys_admin_role` VALUES ('3', '7', '2');
COMMIT;

-- ----------------------------
-- Table structure for tb_test_query_wrapper
-- ----------------------------
DROP TABLE IF EXISTS `tb_test_query_wrapper`;
CREATE TABLE `tb_test_query_wrapper` (
  `tx_sri_no` varchar(32) NOT NULL COMMENT '主键',
  `busi_no` varchar(32) DEFAULT NULL COMMENT '业务编号',
  `cust_no` varchar(16) DEFAULT NULL COMMENT '客户编号',
  `cust_name` varchar(64) DEFAULT NULL COMMENT '客户名称',
  `state` varchar(1) DEFAULT NULL COMMENT '状态(0:无效; 1:有效)',
  `create_time` varchar(18) DEFAULT NULL COMMENT '创建时间',
  `update_time` varchar(18) DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`tx_sri_no`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='用于测试自定义的QueryWrapper类';

-- ----------------------------
-- Records of tb_test_query_wrapper
-- ----------------------------
BEGIN;
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
